import fetch from "@/fetch";

// 首页获取资源
export const getResourceList = () => {
  return fetch({
    method: "get",
    url: "/resource/list",
  });
};

// 搜索接口
export const homeSearch = (params) => {
  return fetch({
    method: "get",
    url: "/resource/homeSearch",
    params,
  });
};

// 资源权限校验
export const permissionVerification = (params) => {
  return fetch({
    method: "get",
    // url: "/secretKey/permissionVerification",
    url:'/permission/judge',
    params,
  });
};

// 全部资源名称
export const getTitleList = () => {
  return fetch({
    method: "get",
    url: "/resource/titleList",
  });
};


// 顶部栏标题
export const headLineTitle = () => {
  return fetch({
    method: "get",
    url: "/resource/headLineTitle",
  });
};

// 修改密码
export const updateInfo = (params) => {
  return fetch({
    method: "post",
    url: "/user/updateInfo",
    data: params,
    loading: true,
  });
};
// // 测试
// export const test = () => {
//   return fetch({
//     method: "get",
//     url: "/test",
//     loading: true,
//   });
// };
// 问答机器人
export const robotAnswer = (params) => {
  return fetch({
    method: "get",
    url: "/charge/search",
    params,
    loading: false,
  });
};
export const robotAnswerList = (params) => {
  return fetch({
    method: "get",
    url: "/charge/list",
    params,
    loading: false,
  });
};